package net.huosen.blog.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import net.huosen.blog.dao.IArticleDao;
import net.huosen.blog.model.Article;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Component;

@Component("articleDao")
public class ArticleDaoImpl implements IArticleDao {

	@Resource(name="hibernateTemplate")
	private HibernateTemplate template;
	
	@Override
	public List<Article> getList() {
		
		return template.find("from Article");
	}

	@Override
	public int insert(Article article) {
		int x=(Integer) template.save(article);
        return x;
	}

}
